package com.qdxwx.data.mapper.user;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.user.UserLetter;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Repository
public interface UserLetterMapper {
    /**
     * 添加站内信
     */
    int insertUserLetter(UserLetter userLetter);

    int deleteUserLetter(long id, long userId);

    int deleteUserLetterBatch(UserLetter userLetter);

    int updateIsReadBatch(UserLetter userLetter);

    int updateIsReadById(long id);

    /*通过id查询消息*/
    UserLetter selectUserLetterById(long id);

    /**
     * 查询站内信收件箱
     *
     * @param userLetter 站内信实体
     * @return List<UserLetter> 站内信收件箱List
     */
    List<UserLetter> selectUserLetterList(@Param("e") UserLetter userLetter, @Param("page") PageRequest page);

    int countUserLetter(@Param("e") UserLetter userLetter);

    int updateCombine(long userId1, long userId2);
}